import React, { Component } from 'react'
import {NavLink} from 'react-router-dom'

export default class List extends Component {
  constructor() {
    super()
    this.state = {
      goodsList: [
        {name: 'Mac Book Pro', price: 14999},
        {name: 'Mate Book', price: 7799},
        {name: 'DELL', price: 9999}
      ]
    }
  }
  render() {
    return (
      <div>
        {
          this.state.goodsList.map((item, index) => {
            return (
              <NavLink key={index} to={'/detail/'+item.name}>{item.name}</NavLink>
            )
          })
        }
      </div>
    )
  }
}
